
package com.zzvcom.sms.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.InputStream;
import java.util.Properties;

public class PropUtil {
    private static Properties properties = null;
    private static final Logger LOGGER = LoggerFactory.getLogger(PropUtil.class);

    public PropUtil() {
    }

    public static String getProp(String key, String defValue) {
        if (properties == null) {
            return defValue;
        } else {
            String value = properties.getProperty(key);
            return value != null ? value : defValue;
        }
    }

    static {
        try {
            properties = new Properties();
            InputStream is = PropUtil.class.getClassLoader().getResourceAsStream("sms-sdk.properties");
            properties.load(is);
        } catch (Exception var1) {
            LOGGER.info(var1.getMessage());
        }

    }
}
